package JavaSEAdvance.day10_MapAndStream;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Xiao
 * @date 2021/7/28
 */
public class D10_4StreamDemo02 {
    /**
     * 需求：
     *      将集合中的字符串，删除前2个，去掉长度大于4的，去除重复，遍历输出
     */
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>(List.of("迪丽热巴", "古力娜扎", "马尔扎哈", "亚里士多德", "珍妮玛事多", "马尔扎哈"));
        list.stream().skip(2).filter(s -> s.length() <= 4).distinct().forEach(s -> System.out.println(s));
    }
}
